﻿using System;
using System.Net;
using SMS.Entities.BaseClasses;

namespace SMS.Entities
{
    public class LoginHistory : BaseEntity
    {
        private int _ID;

        public int ID
        {
            get { return _ID; }
            set { _ID = value; OnPropertyChanged("ID"); }
        }

        private string _UserName;

        public string UserName
        {
            get { return _UserName; }
            set { _UserName = value; OnPropertyChanged("UserName"); }
        }

        public string LoginDateString
        {
            get { return LoginTime.ToShortDateString(); }
            set { }
        }

        public string LoginTimeString
        {
            get { return LoginTime.ToShortTimeString(); }
            set { }
        }

        public string LogoutTimeString
        {
            get { return LogoutTime == DateTime.MinValue ? "N/A" : LogoutTime.ToShortTimeString(); }
            set { }
        }

        private DateTime _LoginTime;

        public DateTime LoginTime
        {
            get { return _LoginTime; }
            set { _LoginTime = value; OnPropertyChanged("LoginTime"); }
        }

        private DateTime _LogoutTime;

        public DateTime LogoutTime
        {
            get { return _LogoutTime; }
            set { _LogoutTime = value; OnPropertyChanged("LogoutTime"); }
        }
    }
}
